/********************************************************************
 * Author: DO HOANG HAI
 * Date of Creation: 21/Aug/2007
 * Last modification: 30/Aug/2007
 * 
 * Description: this class represent information of an item in the database
 * 
 *******************************************************************/

using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using Pbdms.Common;

namespace Pbdms.Common.DataObject
{
    /// <summary>
    /// Represent a pair of bibTex specification 
    /// e.g: "title" as the name, "computer network" as a value
    /// </summary>
    public class BibTexStruct
    {
        public String name;
        public String value;
        public BibTexStruct(){}
        public BibTexStruct(String name, String value)
        {
            this.name = name;
            this.value = value;
        }
    }
    /// <summary>
    /// Represents information of an item in the database
    /// </summary>
    [System.Xml.Serialization.XmlInclude(typeof(BibTexStruct))]
    public class Item
    {
        #region private members

        private String id;
        private bool bPrivate;
        private String category = "Papers";
        private ArrayList sBibTexes = new ArrayList();

        #endregion

        #region public properties
        /// <summary>
        /// get and set the id of the item
        /// </summary>
        public String Id
        {
            get { return id; }
            set { id = value; }
        }
       
        /// <summary>
        /// get and set the BPrivate of the item
        /// </summary>
        public bool BPrivate
        {
            get { return bPrivate; }
            set { bPrivate = value; }
        }
      
        /// <summary>
        /// get and set the Category of the item
        /// </summary>
        public String Category
        {
            get { return category; }
            set { category = value; }
        }
       
        /// <summary>
        /// get and set the array list of Bibtexes of the item
        /// </summary>
        public ArrayList BibTexes
        {
            get { return sBibTexes; }
            set { sBibTexes = value; }
        }
        #endregion

        #region constructors
        public Item() { }
        /// <summary>
        /// create an Item, default value for category is "Papers"
        /// </summary>
        /// <param name="id"></param>
        /// <param name="bPrivate"></param>
        public Item(String id)
        {
            this.id = id;
            
        }
        /// <summary>
        /// create an Item, default value for category is "Papers"
        /// </summary>
        /// <param name="id"></param>
        /// <param name="bPrivate"></param>
        /// <param name="category"></param>
        /// <param name="sBibTexes"></param>
        public Item(string id, bool bPrivate, String category, ArrayList sBibTexes)
        {
            this.id = id;
            this.bPrivate = bPrivate;
            this.category = category;
            this.sBibTexes = sBibTexes;

        }

        #endregion

        #region private methods
        #endregion

        #region public methods

        //public static Item create(String id, bool bPrivate)
        //{
        //    return new Item(id, bPrivate);
        //}
        #endregion

    }
}
